﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.SqlClient;

/// <summary>
/// Summary description for DAL_Tintuc
/// </summary>
public class DAL_Tintuc
{
    DbProvider Dbpro = new DbProvider();
    public DataTable LayTinTuc()
    {
        
        DataTable dt = new DataTable();
        string sql = "SELECT * FROM NewsEvents WHERE Status = '1'";
        try
        {

           dt = Dbpro.ExecuteQuery(sql);
        }
        catch (Exception Ex)
        {

            throw new Exception(Ex.Message);
        }
        return dt;
    }
    public DataTable Chitiet(string id)
    {
        DataTable dt = new DataTable();
        string sql = string.Format("SELECT * FROM NewsEvents WHERE Status = '1' and Id = '{0}'",id);
        try
        {

            dt = Dbpro.ExecuteQuery(sql);
        }
        catch (Exception Ex)
        {

            throw new Exception(Ex.Message);
        }
        return dt;
    }
}